<html><head><title>Define</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="5">Define</font></b></p>

<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#006666">Define</font></b>.&#060;type&#062; [&#060;variable&#062; [= &#060;expression&#062;], &#060;variable&#062; [= &#060;expression&#062;], ...]
</font></pre></blockquote>
<b>Description</b><br><blockquote>


If no &#060;variables&#062; are specified, <b><font color="#006666">Define</font></b> is used to change the default type for future untyped <a href="../reference/variables.html">variables</a> 
(including <a href="../reference/procedures.html">procedure</a> parameters, <a href="../reference/interfaces.html">interface</a> method parameters 
and data to read with the <a href="../reference/data.html">Read</a> keyword). 
The initial default type is integer (.i). Each variable can have a default value directly assigned to it. <br>
<br>
<b><font color="#006666">Define</font></b> may also be used with <a href="../reference/dim.html">arrays</a>, 
<a href="../reference/newlist.html">lists</a> and <a href="../reference/newmap.html">maps</a>. <br>

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  d = e + f
  <b><font color="#006666">Define</font></b>.w
  a = b + c 
</font></pre>

d, e and f will be created as integer type variables, since there was no type specified. a, b and c will be 
signed word typed (.w) as no type is specified and the default type had been changed to the word type. <br>
<br>
If variables are specified, <b><font color="#006666">Define</font></b> only declares these variables as "defined type" and will not change the default type. 
If you don't assign a value to the variables at this time, the value will be 0. 

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Define</font></b>.b a, b = 10, c = b*2, d <font color="#006666">; these 4 variables will be byte typed (.b)</font>
</font></pre>


</blockquote>
<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#006666">Define</font></b> &#060;variable&#062;.&#060;type&#062; [= &#060;expression&#062;] [, &#060;variable&#062;.&#060;type&#062; [= &#060;expression&#062;], ...] 
</font></pre></blockquote>
<b>Description</b><br><blockquote>


Alternative possibility for the variable declaration using <b><font color="#006666">Define</font></b>. 

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">Define</font></b> MyChar.c 
  <b><font color="#006666">Define</font></b> MyLong.l 
  <b><font color="#006666">Define</font></b> MyWord.w 
  
  <b><font color="#006666">Debug</font></b> <font color="#006666">SizeOf</font>(MyChar)   <font color="#006666">; will print 1 in ASCII mode, and 2 in unicode mode</font>
  <b><font color="#006666">Debug</font></b> <font color="#006666">SizeOf</font>(MyLong)   <font color="#006666">; will print 4</font>
  <b><font color="#006666">Debug</font></b> <font color="#006666">SizeOf</font>(MyWord)   <font color="#006666">; will print 2</font>
</font></pre>
</body></html>